#include "BackGround.h"

BackGround::BackGround()
{
	this->loadImageWith("bg.png");
}

BackGround::~BackGround()
{
}

void BackGround::getDirection(int direction)
{
	this->direction = direction;
}

void BackGround::update(CDC* mdc)
{
	if (direction == 1) {
		if (x < 265)
			x += 3;
	}
	else if (direction == 2) {
		if (x >= 0)
			x -= 3;
	}
	drawBg(mdc);
}

void BackGround::drawBg(CDC* mdc)
{
	image.AlphaBlend(mdc->m_hDC, 0, 0, image.GetWidth(), image.GetHeight(), 0, 0, image.GetWidth(), image.GetHeight());
}
